import { get, post, put, Delete, download } from './http';
import { url } from "./url"

/* 基础接口 */
const getLogin = (data) => post(url + '/laboratory/sysUser/login', data); //登录
const outLogin = (data) => post(url + '/laboratory/sysUser/outLogin', data); //退出登录
const findLaboratoryByCollegeNo = (data) => get(url + '/laboratory/baseLaboratory/findLaboratoryByCollegeNo', data); //查询用户学院、实验室

const colleges = (data) => post(url + '/laboratory/baseColleges/findListByUser', data); //院校下拉
const laboratory = (data) => post(url + '/laboratory/baseLaboratory/findLaboratoryByFloor', data); //实验室下拉
const department = (data) => post(url + '/laboratory/baseDepartment/findListByUser', data); //院系下拉
const userInfo = (data) => get(url + '/laboratory/sysUser/detail', data); //用户信息


/* 总览接口 */
const monitorData = (data) => post(url + '/laboratory/frontpage/monitorData', data); //首页—->监管概览数据查询
const notPassRate = (data) => post(url + '/laboratory/frontpage/notPassRate', data); //首页—->不合格率查询
const findUsingCondition = (data) => post(url + '/laboratory/frontpage/findUsingCondition', data); //检测设备管理—->使用情况数据查询
const selectEnvList = (data) => post(url + '/laboratory/frontpage/selectEnvList', data); //检测设备管理—->设备列表中的使用记录
const pointAllInfo = (data) => post(url + '/laboratory/frontpage/pointAllInfo', data); //首页—->地图点位信息查询
const eventList = (data) => post(url + '/laboratory/frontpage/eventList', data); //首页—->实时事件列表查询
const difEventOfNum = (data) => post(url + '/laboratory/frontpage/difEventOfNum', data); //首页—->实时事件事件类型数量查询
const frontpageexport = (data) => download(url + '/laboratory/frontpage/export', data); //首页—->实时事件excel导出-
const eventListOfNow = (data) => post(url + '/laboratory/frontpage/eventListOfNow', data); //首页—-实时事件列表查询显示当天前10条

/* 设备管理 */
const searchAll = (data) => post(url + '/laboratory/baseEquipment/searchAll', data); //检测设备管理—>设备不同状态对应的数量
const selectList = (data) => post(url + '/laboratory/baseEquipment/selectList', data); //检测设备管理和耗材列表管理 公用一个接口，根据 equipmentType 设备类型来区分
const findPage = (data) => post(url + '/laboratory/baseLaboratory/findPage', data); //实验室列表
const laboratoryEquipmentUse = (data) => post(url + '/laboratory/equipmentUsageRecord/searchByName', data); //检测设备管理—->设备列表中的使用记录
const equipmentUsageexport = (data) => download(url + '/laboratory/equipmentUsageRecord/excel', data); //设备列表中的使用记录导出excel
const equipmentEvent = (data) => post(url + '/laboratory/equipmentEvent/selectList', data); //检测设备管理—->设备列表中的异常
const equipmentMaintainfindCount = (data) => post(url + '/laboratory/equipmentMaintain/findCount', data); //检测设备管理—->设备列表中的维护记录次数
const equipmentMaintain = (data) => post(url + '/laboratory/equipmentMaintain/selectList', data); //检测设备管理—->设备列表中的维护记录
const baseEquipmentExport = (data) => download(url + '/laboratory/baseEquipment/findExcel', data); //设备列表导出

// 耗材管理
const warehousingList = (data) => post(url + '/laboratory/baseConsumables/searchByName', data); //耗材管理—->耗材入库记录
const exportWarehousing = (data) => download(url + '/laboratory/baseConsumables/exportWarehousing', data); //耗材管理—->耗材入库记录数据清单excel导出
const exportInStock = (data) => download(url + '/laboratory/baseConsumables/exportInStock', data); //耗材管理—->耗材库存excel导出
const consumablesRequisition = (data) => post(url + '/laboratory/consumablesRequisition/searchByName', data); //耗材管理—->领用记录查询
const requisitionexport = (data) => download(url + '/laboratory/consumablesRequisition/export', data); //耗材管理—->耗材领用记录excel导出

// 环境管理
const devicefindList = (data) => post(url + '/laboratory/baseEquipment/findList', data); //设备下拉接口
const envManagefindPage = (data) => post(url + '/laboratory/envManage/findPage', data); //环境监测数据列表
const envManageexport = (data) => download(url + '/laboratory/envManage/findList', data); //环境监测数据导出
const errorfindPage = (data) => post(url + '/laboratory/equipmentEvent/findPage', data); //异常列表
const errorenvManageexport = (data) => download(url + '/laboratory/equipmentEvent/findList', data); //异常列表导出
const deviceInfo = (data) => post(url + '/laboratory/equipmentMaintain/findPage', data); //设备信息列表
const devicefindPage = (data) => post(url + '/laboratory/baseEquipment/findPage', data); //设备信息列表

// 门禁
const accessManage = (data) => post(url + '/laboratory/accessManage/findPage', data); //门禁列表
const accessManageexport = (data) => download(url + '/laboratory/accessManage/findExcel', data); //异常列表导出

// 能耗
const energyManage = (data) => post(url + '/laboratory/energyManage/findPage', data); //门禁列表

//视频管理
const getliveUrl = (data) => post(url + '/laboratory/ys/getliveUrl', data); //获取设备播放流
const findFloorByUser = (data) => post(url + '/laboratory/baseFloor/findFloorByUser', data); //楼层下拉
const findVideoPage = (data) => post(url + '/laboratory/baseEquipment/findVideoPage', data); //视频列表
const getSnapPicture = (data) => post(url + '/laboratory/ys/getSnapPicture', data); //设备抓拍图片



// 审核管理
const consumablesReview = (data) => post(url + '/laboratory/consumablesReview/findPage', data); //审核列表
const consumablesReviewaudit = (data) => post(url + '/laboratory/consumablesReview/audit', data); //审核操作

// 事件管理
const findPageByManage = (data) => post(url + '/laboratory/equipmentEvent/findPageByManage', data); //事件列表
const findListByManage = (data) => download(url + '/laboratory/equipmentEvent/findListByManage', data); //事件列表导出

// 维护管理
const miantainfindList = (data) => post(url + '/laboratory/equipmentMaintain/findList', data); //维护列表
const miantainfindListByExcel = (data) => download(url + '/laboratory/equipmentMaintain/findListByExcel', data); //维护导出
const addequipmentMaintain = (data) => post(url + '/laboratory/equipmentMaintain', data); //维护新增
const findEquipmentByLaboratory = (data) => post(url + '/laboratory/baseEquipment/findLaboratoryEquipment', data); //设备下拉

// 信息公开
const filefindPage = (data) => post(url + '/laboratory/file/findPage', data); //文件列表
const fileuploadFile = (data) => post(url + '/laboratory/file/uploadFile', data); //上传文件
const downloadFile = (data, name) => download(url, data, name);//报告报表文件下载



// 后台管理
const baseLaboratoryadd = (data) => post(url + '/laboratory/baseLaboratory', data); //实验室新增
const adminEquipmentMaintain = (data) => post(url + '/laboratory/equipmentMaintain/equipmentList', data); //后端管理—->设备管理列表查询
const adminConsumablesList = (data) => post(url + '/laboratory/baseConsumables/consumablesList', data); //后端管理—->耗材管理列表查询
const addEquipment = (data) => post(url + '/laboratory/equipmentMaintain/addEquipment', data); //后端管理，设备新增
const addConsumables = (data) => post(url + '/laboratory/baseConsumables/addConsumables', data); //后端管理，耗材入库新增
const equipmentNameIsRepeat = (data) => post(url + '/laboratory/equipmentMaintain/equipmentNameIsRepeat', data); //后端管理—->设备管理查询设备名称是否重复
const consumablesInfo = (data) => post(url + '/laboratory/baseConsumables/consumablesInfo', data); //后端管理，耗材入库新增
const equipmentInfo = (data) => post(url + '/laboratory/equipmentMaintain/equipmentInfo', data); //后端管理，设备新增初始化信息
const findEquimentList = (data) => post(url + '/laboratory/baseConsumables/findEquimentList', data); //后端管理，设备新增初始化信息，耗材柜查询
const factoryInfo = (data) => get(url + `/laboratory/equipmentMaintain/factoryInfo?factoryName=${data.factoryName}`); //实验室管理—->检测设备管理—>新增设备初始化厂家信息

export {
  getLogin,
  findLaboratoryByCollegeNo,
  outLogin,
  colleges,
  laboratory,
  department,
  userInfo,

  // 总览
  monitorData,
  notPassRate,
  findUsingCondition,
  selectEnvList,
  pointAllInfo,
  eventList,
  difEventOfNum,
  frontpageexport,
  eventListOfNow,

  // 设备管理
  searchAll,
  selectList,
  findPage,
  laboratoryEquipmentUse,
  equipmentUsageexport,
  equipmentEvent,
  equipmentMaintainfindCount,
  equipmentMaintain,
  baseEquipmentExport,

  // 耗材管理
  warehousingList,
  exportWarehousing,
  exportInStock,
  consumablesRequisition,
  requisitionexport,

  // 环境管理
  devicefindList,
  envManagefindPage,
  envManageexport,
  errorfindPage,
  errorenvManageexport,
  deviceInfo,
  devicefindPage,

  // 门禁管理
  accessManage,
  accessManageexport,

  // 能耗列表
  energyManage,

  // 视频管理
  getliveUrl,
  findFloorByUser,
  findVideoPage,
  getSnapPicture,

  // 审核管理
  consumablesReviewaudit,
  consumablesReview,

  // 事件列表
  findPageByManage,
  findListByManage,

  //维护管理
  miantainfindList,
  miantainfindListByExcel,
  addequipmentMaintain,
  findEquipmentByLaboratory,

  //信息管理
  filefindPage,
  fileuploadFile,
  downloadFile,

  // 后台管理
  baseLaboratoryadd,
  adminEquipmentMaintain,
  adminConsumablesList,
  addEquipment,
  addConsumables,
  equipmentNameIsRepeat,
  consumablesInfo,
  equipmentInfo,
  findEquimentList,
  factoryInfo

}